#include<iostream>
using namespace std;

#include<unistd.h>
#include<sys/types.h>

int main()
{
  pid_t ret = fork();
  if(ret == 0)
  {
    while(1)
    {
      cout << "I'm son process, my PID: " << getpid() << " PPID: " << getppid() << endl;
      sleep(1);
    }
  }
  else if(ret > 0)
  {
    while(1)
    {
      cout << "I'm father process, my PID: " << getpid() << " PPID: " << getppid() << endl;
      sleep(1);
    }
  }
  else
  {
    while(1)
    {
      cout << "Make son process fail!" << endl;
      sleep(1);
    }
  }

  return 0;
}


